package org.openjsonp.json.stream;

import javax.json.stream.JsonLocation;

/**
 * Implementation of the interface {@link javax.json.stream.JsonLocation
 * JsonLocation}.
 * 
 */
public class JsonLocationImpl implements JsonLocation {

	private long lineNumber;

	private long columnNumber;

	private long streamOffset;

	/**
	 * Default constructor. Build a new object with the lineNumber, columnNumber
	 * and streamOffset with the value -1.
	 */
	public JsonLocationImpl() {
		lineNumber = -1;
		columnNumber = -1;
		streamOffset = -1;
	}

	/**
	 * Build a new object with a specified lineNumber but the columnNumber and
	 * streamOffset with the value -1.
	 * 
	 * @param lineNumber the line number
	 */
	public JsonLocationImpl(long lineNumber) {
		this.lineNumber = lineNumber;
		columnNumber = -1;
		streamOffset = -1;
	}

	/**
	 * Build a new object with a specified lineNumber and columnNumber but the
	 * streamOffset with the value -1.
	 * 
	 * @param lineNumber the line number
	 * @param columnNumber the column number
	 */
	public JsonLocationImpl(long lineNumber, long columnNumber) {
		this.lineNumber = lineNumber;
		this.columnNumber = columnNumber;
		streamOffset = -1;
	}

	/**
	 * Build a new object with a specified lineNumber, columnNumber and
	 * streamOffset.
	 * 
	 * @param lineNumber the line number
	 * @param columnNumber the column number
	 * @param streamOffset the stream offset
	 */
	public JsonLocationImpl(long lineNumber, long columnNumber, long streamOffset) {
		this.lineNumber = lineNumber;
		this.columnNumber = columnNumber;
		this.streamOffset = streamOffset;
	}

	@Override
	public long getLineNumber() {
		return lineNumber;
	}

	@Override
	public long getColumnNumber() {
		return columnNumber;
	}

	@Override
	public long getStreamOffset() {
		return streamOffset;
	}

}
